<div class="alert alert-info">
    <h4>Daftar KK</h4>
</div>
<div class="row-fluid">
    <div class="span2">
        <p><?php echo anchor('petugas/kk_tambah', '<button class="btn btn-primary" type="submit"><i class="icon-plus icon-white"></i> Tambah</button>'); ?></p>
    </div>
    <div class="span2">
        <p><?php echo anchor('petugas/kk_baru', '<button class="btn btn-primary" type="submit"><i class="icon-plus icon-white"></i> Baru</button>'); ?></p>
    </div>
    <div class="control-group">
        <div class="controls">
            <div class="input-append">
                <?php
                $att = array(
                    'class' => 'form-vertical'
                );
                echo form_open('petugas/result', $att);
                ?>
                <input id="appendedInputButton" class="span2" type="text" size="16" name="search">
                <button class="btn" type="submit">Cari!</button>
                <?php echo form_close() ?>
            </div>
        </div>
    </div>
</div>
<?php
if (empty($kk)) {
    echo '<div class ="alert alert-error">Tidak ada data Kartu Keluarga</div>';
} else {
    ?>
    <div class="row-fluid">
        <div class="span8">
            <table class="table table-striped table-bordered table-condensed">
                <thead>
                    <tr>
                        <th>No KK</th>
                        <th>Nama</th>
                        <th>Tanggal</th>
                        <th>Username</th>
                        <th>Action</th>
                    </tr>
                </thead>
                <tbody>
                    <?php foreach ($kk as $pd) : ?>
                        <tr>
                            <td><a href="<?php echo site_url() ?>/detail/kk/<?php echo $pd->id ?>"><?php echo $pd->id ?></a></td>
                            <td>
                                <?php
                                $nama = $pd->nama;
                                $nik = $pd->nik;
                                echo anchor('detail/nik/' . $nik, $nama);
                                ?>
                            </td>
                            <td><?php echo $pd->date ?></td>
                            <td><?php echo $pd->username ?></td>
                            <td><?php echo anchor('petugas/kk_edit/' . $pd->id, '<i class="icon-pencil tool"></i>'); ?> | <?php echo anchor('petugas/kk_del/' . $pd->id, '<i class="icon-remove tool"></i>'); ?></td>
                        </tr>
                    <?php endforeach; ?>
                </tbody>
            </table>
        </div><!--/span-->
    </div>
    <?php
}?>